import webapp2
import cgi
import datetime
from google.appengine.ext import db
from google.appengine.api import users


class ODBevent(db.Model):
  utente = db.StringProperty(required=True)
  attributo = db.StringProperty(required=True)
  valore = db.StringProperty(required=True)
  datainserimento = db.DateTimeProperty(required=True)
  

class MainPage(webapp2.RequestHandler):
	def get(self):
		
		self.response.headers['Content-Type'] = 'text/plain'
		ut=cgi.escape(self.request.get('utente'))
		uattributo=cgi.escape(self.request.get('attributo'))
		uvalore=cgi.escape(self.request.get('valore'))
		e = ODBevent(utente=ut,attributo=uattributo,valore=uvalore,datainserimento=datetime.datetime.now())
		e.put()
app = webapp2.WSGIApplication([('/', MainPage)],
                              debug=True)
							  